This sample demonstrates the use of an NBP mapper to look up NBP entities on an AppleTalk network using Open Transport. The code from this sample is featured in the latest release (v1.2) of the book “Inside Macintosh: Open Transport”.
Packing List
The package contains the following items items:
• OTLookupNameTest-PPC.µ — A project to build the PPC version.
• OTLookupNameTest-PPC — A compiled version of the above.
• OTLookupNameTest-68K.µ — A project to build the 68K version.
• OTLookupNameTest-68K — A compiled version of the above.
• OTLookupNameTest.c — Source code common to both projects.
Sample Requirements
I tested this code with OT 1.2 running under Mac OS 8 on both 68K and PPC. The code should run just fine with OT 1.1.1 or newer. I do not support this code on OT versions prior to 1.1.1.
There is a bug in OT 1.2 and earlier that prevents the 68K version of this sample from running on PPC machines. The specific problem is that OTUseSyncIdleEvents crashes when called from 68K code on a PPC. This bug has been fixed in OT 1.3.
Running the Sample
To run the sample, simply double click the application and read the output on the console window. The sample looks up and prints information about all the AppleShare file servers in your AppleTalk zone. If you don’t have any AppleShare file servers in your zone, you can modify the requestAddress variable in the main function to look up some other type of NBP entity.
Building the Sample
The sample was built using the Metrowerks CodeWarrior 11 environment and the Open Transport 1.1.1 SDK interfaces and libraries.
To rebuild the sample, first open the project and change the “LatestInterfaces” and “LatestLibraries” access paths to point to the interfaces and libraries from the OT 1.1.1 (or newer) SDK. Then choose Make from the Project menu.
Credits and Version History
If you find any problems with this sample, mail <DevSupport@apple.com> with “Attn: Quinn” as the first line of your mail and I’ll try to fix them up.